Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW (admin only) Icon component #944

Closed

Conversation

carstingaxion
Copy link
Collaborator

@carstingaxion carstingaxion commented Oct 11, 2024

Description of the Change

image

image

image

Closes #

How to test the Change

Changelog Entry

Added - New Icon component to be used with the blocks (admin only)

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link

what-the-diff bot commented Oct 11, 2024

PR Summary

  • Added new Dependencies
    The @wordpress/icons package has been added to the project. It's a new software unit that our project relies on, mentioned in our tracking files on what is necessary to build our software.

  • Removed License Entry
    The redundant "license" field for the @wordpress/icons package was eliminated from the tracking file (package-lock.json). This helps to keep our tracking files clean and efficient.

  • Created Icon Component
    A new element for the user interface, simply referred to as Icon.js, was constructed. This is what it does:

    • Displays an icon. The visual representation changes based on the iconName prop (a property that determines which icon to show).
    • Overlays a "nametag" icon on top of the main icon. This is achieved via the ZStack component from WordPress (a tool that allows stacking elements in a particular order).
    • Present a style consistent with the current WordPress admin color palette. This means that our software's appearance will adapt to match the administrative interface of WordPress.
    • Included clear examples and comments inside the documentation. This provides future developers on this project with a better understanding of how the Icon.js component works. This ongoing ease of understanding facilitates smoother updates and maintenance in the future.

Copy link

Preview changes with Playground

You can preview the recent changes for PR#944 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri
Copy link
Contributor

mauteri commented Oct 12, 2024

@carstingaxion looks like Playgroud is crashing at the moment (see below). I also tried checking out the branch, and I don't see the GatherPress icons in my local environment. I see it's just a component in the src directory without something in build. I tried to build but didn't see any changes.

Screenshot 2024-10-11 at 9 27 43 PM

Error message

[12-Oct-2024 01:27:31 UTC] JavaScript Warn: The "pluginZipFile" option of the "installPlugin" step is deprecated. Use "pluginData" instead.
[12-Oct-2024 01:27:32 UTC] JavaScript Warn: The "pluginZipFile" option of the "installPlugin" step is deprecated. Use "pluginData" instead.
[12-Oct-2024 01:27:34 UTC] JavaScript Error: Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944".
Check if the URL is correct and the server is reachable.
If it is reachable, the server might be blocking the request.
Check the browser console and network tabs for more information.

Does the console show the error "No 'Access-Control-Allow-Origin' header"?

This means the server that hosts your file does not allow requests from other sites
(cross-origin requests, or CORS).You need to move the asset to a server that allows
cross-origin file downloads. Learn more about CORS at
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

If your file is on GitHub, load it from "raw.githubusercontent.com".
Here's how to do that:

  1. Start with the original GitHub URL of the file. For example:
    https://github.com/username/repository/blob/branch/filename.
  2. Replace "github.com" with "raw.githubusercontent.com".
  3. Remove the "/blob/" part of the URL.

The resulting URL should look like this:
https://raw.githubusercontent.com/username/repository/branch/filename

Error:
Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944"
at Zl.resolve (https://playground.wordpress.net/assets/config-780e2ec5.js:723:3621)
at async no.run (https://playground.wordpress.net/assets/config-780e2ec5.js:4:2176)
[12-Oct-2024 01:27:34 UTC] JavaScript Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944".
Check if the URL is correct and the server is reachable.
If it is reachable, the server might be blocking the request.
Check the browser console and network tabs for more information.

Does the console show the error "No 'Access-Control-Allow-Origin' header"?

This means the server that hosts your file does not allow requests from other sites
(cross-origin requests, or CORS).You need to move the asset to a server that allows
cross-origin file downloads. Learn more about CORS at
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

If your file is on GitHub, load it from "raw.githubusercontent.com".
Here's how to do that:

  1. Start with the original GitHub URL of the file. For example:
    https://github.com/username/repository/blob/branch/filename.
  2. Replace "github.com" with "raw.githubusercontent.com".
  3. Remove the "/blob/" part of the URL.

The resulting URL should look like this:
https://raw.githubusercontent.com/username/repository/branch/filename

Error:
Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944"
Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944".
Check if the URL is correct and the server is reachable.
If it is reachable, the server might be blocking the request.
Check the browser console and network tabs for more information.

Does the console show the error "No 'Access-Control-Allow-Origin' header"?

This means the server that hosts your file does not allow requests from other sites
(cross-origin requests, or CORS).You need to move the asset to a server that allows
cross-origin file downloads. Learn more about CORS at
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

If your file is on GitHub, load it from "raw.githubusercontent.com".
Here's how to do that:

  1. Start with the original GitHub URL of the file. For example:
    https://github.com/username/repository/blob/branch/filename.
  2. Replace "github.com" with "raw.githubusercontent.com".
  3. Remove the "/blob/" part of the URL.

The resulting URL should look like this:
https://raw.githubusercontent.com/username/repository/branch/filename

Error:
Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944"
at Zl.resolve (https://playground.wordpress.net/assets/config-780e2ec5.js:723:3621)
at async no.run (https://playground.wordpress.net/assets/config-780e2ec5.js:4:2176)
[12-Oct-2024 01:27:34 UTC] JavaScript Error: Error when executing the blueprint step #5 ({"step":"writeFile","path":"/wordpress/pr/pr.zip","data":{"resource":"url","url":"https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944","caption":"Downloading GatherPress/gatherpress PR #944"},"progress":{"weight":2,"caption":"Applying GatherPress/gatherpress PR #944"}}) : Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944".
Check if the URL is correct and the server is reachable.
If it is reachable, the server might be blocking the request.
Check the browser console and network tabs for more information.

Does the console show the error "No 'Access-Control-Allow-Origin' header"?

This means the server that hosts your file does not allow requests from other sites
(cross-origin requests, or CORS).You need to move the asset to a server that allows
cross-origin file downloads. Learn more about CORS at
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

If your file is on GitHub, load it from "raw.githubusercontent.com".
Here's how to do that:

  1. Start with the original GitHub URL of the file. For example:
    https://github.com/username/repository/blob/branch/filename.
  2. Replace "github.com" with "raw.githubusercontent.com".
  3. Remove the "/blob/" part of the URL.

The resulting URL should look like this:
https://raw.githubusercontent.com/username/repository/branch/filename

Error:
Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944"
Error: Error when executing the blueprint step #5 ({"step":"writeFile","path":"/wordpress/pr/pr.zip","data":{"resource":"url","url":"https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944","caption":"Downloading GatherPress/gatherpress PR #944"},"progress":{"weight":2,"caption":"Applying GatherPress/gatherpress PR #944"}}) : Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944".
Check if the URL is correct and the server is reachable.
If it is reachable, the server might be blocking the request.
Check the browser console and network tabs for more information.

Does the console show the error "No 'Access-Control-Allow-Origin' header"?

This means the server that hosts your file does not allow requests from other sites
(cross-origin requests, or CORS).You need to move the asset to a server that allows
cross-origin file downloads. Learn more about CORS at
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

If your file is on GitHub, load it from "raw.githubusercontent.com".
Here's how to do that:

  1. Start with the original GitHub URL of the file. For example:
    https://github.com/username/repository/blob/branch/filename.
  2. Replace "github.com" with "raw.githubusercontent.com".
  3. Remove the "/blob/" part of the URL.

The resulting URL should look like this:
https://raw.githubusercontent.com/username/repository/branch/filename

Error:
Error: Could not download "https://hub.carsten-bach.de/gatherpress/plugin-proxy.php/?org=GatherPress&repo=gatherpress&workflow=Playground%20Preview&artifact=gatherpress-pr&pr=944"
at Object.run (https://playground.wordpress.net/assets/config-780e2ec5.js:754:145826)
at async cu (https://playground.wordpress.net/assets/config-780e2ec5.js:754:147345)
at async Cu (https://playground.wordpress.net/assets/config-780e2ec5.js:758:6330)
at async https://playground.wordpress.net/assets/main-95b7d37f.js:176:2459

@mauteri
Copy link
Contributor

mauteri commented Oct 14, 2024

Spoke to @carstingaxion about this in our meeting. Going to close this PR.

@mauteri mauteri closed this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants